package ift605.EquationWithTrainingAgents.behavior.special;

import java.util.List;

import ift605.EquationWithTrainingAgents.behavior.common.DeriverBehavior;
import ift605.EquationWithTrainingAgents.struct.DerivationInfo;
import udes.ds.agent.BasicEquation;

public class MultiplyCoefficientBehavior extends DeriverBehavior {
	private static final long serialVersionUID = 1L;

	@Override
	public boolean derive(List<DerivationInfo> aDerivationInfos) {
		Object[] values = aDerivationInfos.get(0).Mess.base.getValues();
		if(values.length == 2)
		{
			if(values[0] instanceof Double && values[1] instanceof Integer)
			{
				aDerivationInfos.get(0).Mess.derived = new BasicEquation((Double)((Double)values[0] * (Integer)values[1]), (Integer)values[1]);
			}
		}
		
		return true;
	}
}